﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Practices.Unity;

namespace UnityStudy
{
    class Program
    {
        static void Main(string[] args)
        {
            var container = new UnityContainer();
            container.RegisterType<IA, A>();

            var a1 = container.Resolve<IA>();
            Console.WriteLine(a1.GetHashCode());

            container.RegisterInstance<IA>(a1);

            var a2 = container.Resolve<IA>();
            Console.WriteLine(a2.GetHashCode());
        }
    }

    internal interface IA
    {
    }

    class A : IA
    {
    }
}
